app.filter("proccessname",function(){
    return function(input){
    	 switch (input) {
    	 	case "BGYPSQ": return "办公用品申请"; //办公用品申请
			case "GZYPSQ": return "高值用品申请"; //高值用品申请
			case "GKSQ": return "工卡申请"; //工卡申请
		break;
		default:
			break;
		}
    }
});

app.filter("processOperateTypeFilter",function(){
	return function(input){
		switch (input) {
		case 1: return "发起流程";
		case 2:return  "通过";
		case 3:return "加签";
		case 4:return "撤回";
		case 5:return "驳回";
		break;
		default:
			break;
		}
	}
});
app.filter("processStatusFilter",function(){
	return function(input){
		switch (input) {
		case 1: return "审批中";
		case 2:return  "已通过";
		case 3:return "已结束";
		break;
		default:
			break;
		}
	}
});

app.filter("nullToZero",function(){
	return function(input){
		if(!input){
			return 0;
		}else{
			return input;
		}
	}
});

/* Filters */
/*$sce是angularJS自带的安全处理模块*/
app.filter('trustHtml', function ($sce) {
	return function (input) {
		return $sce.trustAsHtml(input);
	}
});

app.filter("colorFilter",function(){
	return function(input){
		var model = (input + 1) % 4;

		if(model == 0){
			return "trcolor1";
		}
		if(model == 1){
			return "trcolor2";
		}
		if(model == 2){
			return "trcolor3";
		}
		if(model == 3){
			return "trcolor4";
		}
	}
})

